package com.ling.pl.autoproject.builder.model;

import com.ling.pl.core.commons.annotation.AttachMentDropdown;
import com.ling.pl.core.commons.annotation.Dict;
import com.ling.pl.core.commons.annotation.Dropdown;
import com.ling.pl.core.commons.utils.AssertHelper;
import com.ling.pl.core.commons.utils.UnicodeUtils;

public class DefaultPojoField implements PojoField {
    String name;
    String comment;
    String des;
    Boolean isOneToOne;
    Boolean isOneToMany;
    Boolean isSampleField = false;
    String dataType;
    /**
     * JavaScript中对数据类型的描述
     */
    String htmlType;
    /**
     * 编辑框类型
     */
    String showType;
    /**
     * 是否baseEntity类中的字段
     */
    Boolean isNotBaseEntiry = true;
    Dropdown dropdown;
    Dict dict;
    AttachMentDropdown attachMentDropdown;
    /**
     * 是否必须
     */
    Boolean isRequired;
    String dictCode;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Boolean getIsOneToOne() {
        return isOneToOne;
    }

    public void setIsOneToOne(Boolean isOneToOne) {
        this.isOneToOne = isOneToOne;
    }

    public Boolean getIsOneToMany() {
        return isOneToMany;
    }

    public void setIsOneToMany(Boolean isOneToMany) {
        this.isOneToMany = isOneToMany;
    }

    public Boolean getIsSampleField() {
        return isSampleField;
    }

    public void setIsSampleField(Boolean isSampleField) {
        this.isSampleField = isSampleField;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public String toString() {
        return name;
    }

    public Boolean getIsNotBaseEntiry() {
        return isNotBaseEntiry;
    }

    public void setIsNotBaseEntiry(Boolean isNotBaseEntiry) {
        this.isNotBaseEntiry = isNotBaseEntiry;
    }

    public Dropdown getDropdown() {
        return dropdown;
    }

    public void setDropdown(Dropdown dropdown) {
        this.dropdown = dropdown;
    }

    public AttachMentDropdown getAttachMentDropdown() {
        return attachMentDropdown;
    }

    public void setAttachMentDropdown(AttachMentDropdown attachMentDropdown) {
        this.attachMentDropdown = attachMentDropdown;
    }

    public Boolean getIsRequired() {
        return isRequired;
    }

    public void setIsRequired(Boolean isRequired) {
        this.isRequired = isRequired;
    }

    public String getDictCode() {
        return dictCode;
    }

    public void setDictCode(String dictCode) {
        this.dictCode = dictCode;
    }

    public String getASCIIComment() {
        if (AssertHelper.notEmpty(comment)) {
            return UnicodeUtils.chinaToUnicode(comment);
        }
        return null;
    }

    public String getHtmlType() {
        return htmlType;
    }

    public void setHtmlType(String htmlType) {
        this.htmlType = htmlType;
    }

    public Dict getDict() {
        return dict;
    }

    public void setDict(Dict dict) {
        this.dict = dict;
    }

    public String getShowType() {
        return showType;
    }

    public void setShowType(String showType) {
        this.showType = showType;
    }
}
